package com.sdy.supermarket.biz.service;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.sdy.common.model.BizException;
import com.sdy.supermarket.biz.model.GsAppInterface;
import com.sdy.supermarket.biz.model.GsSelfSystem;
import com.sdy.mvc.service.BaseService;
import com.sdy.supermarket.biz.vo.AppUpdateRequest;

import java.util.List;

/**
 * <p>
 * 自建系统 服务类
 * </p>
 *
 * @author zzq
 * @since 2019-07-16
 */
public interface GsSelfSystemService extends BaseService<GsSelfSystem> {
    /**
     * 创建自建系统
     */
    GsSelfSystem createSystem(GsSelfSystem gsSelfSystem);
    
    /**
     * 更新自建系统
     */
    void updateSystem(GsSelfSystem gsSelfSystem) throws BizException;

    /**
     * 根据Code查询自建系统
     */
    GsSelfSystem getByCode(String code);

    /**
     * 查询自建系统接口
     */
    List<GsAppInterface> listApiByCodeAndIp(String code, String ip);

    /**
     * 移除自建系统IP
     */
    void removeIpAuth(String code, String ip);

    /**
     * 更新自建系统
     */
    void updateIpAuth(AppUpdateRequest appUpdateRequest, Integer userId) throws BizException;
}
